{% extends "public/base.html" %}

{% block loader %}
{% endblock %}

{% block position %}
{% endblock %}


{% block js %}
    <script>
        var next_url = "{{ next_url }}";
        var data = {{ message|safe }};


        $(function(){
            console.log(data)
            if(data.status == 0){
                document.title = "操作成功";
                swal({
                    title: "操作成功",
                    text:"",
                    type: "success"
                },function(){
                    if(next_url != ""){
                        setTimeout(function(){
                            window.location.href = next_url
                        }, 150)
                    }

                })
            }else{
                document.title = "操作失败";
                swal({
                    title: "操作失败",
                    text: data.errmsg,
                    type: "error"
                },function(){
                    if(next_url != ""){
                        setTimeout(function(){
                            window.location.href = next_url
                        }, 150)
                    }

                })
            }
        })
    </script>
{% endblock %}